package com.example.bookstore.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
public class Book implements Serializable {

    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;

    private String bookId;//图书序号
    private String bookName;//书名
    private Double price;//价格
    private int inventory;//库存
    private int sales;//销量
    private int status;//状态 1上架/-1下架
    private String author;//作者
    private String bookImg;//封面
    private String introduction;//简介
    private int mt;//大分类
    private int st;//小分类
    private String categoryName;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    //更新时间
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
    //创建人
    @TableField(fill = FieldFill.INSERT)
    private Long createUser;
    //修改人
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;
}
